home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / vdisrc12 / vdirastr.s < prev   
Text File  |  1990-11-23  |  3KB  |  86 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* VDIFAST Public Domain VDI bindings.
  5. ;*
  6. ;*========================================================================
  7.  
  8.           .iif      !(^^macdef VContrl),.include  "vdimacro.s"
  9.           
  10. ;*************************************************************************
  11. ;*
  12. ;* Raster functions. 
  13. ;*
  14. ;*************************************************************************
  15.  
  16. ;*------------------------------------------------------------------------
  17. ;* Copy raster transparent.
  18. ;* Copy raster opaque.
  19. ;*  These functions are pretty similar, so they're kludged together here.
  20. ;*------------------------------------------------------------------------
  21.  
  22. _vrt_cpyfm::
  23.           .cargs    #8,.handle.w,.wrmode.w,.pxy.l,.psource.l,.pdest.l,.color.l
  24.           link      a6,#0
  25.           
  26.           moveq.l   #121,d0             ;* Function code = copy transparent
  27.           moveq.l   #3,d1               ;* Number of intin words = 3. 
  28.           move.l    .color(a6),a0       ;* Get the pointer to the 2-word
  29.           move.l    (a0),-(sp)          ;* color array, copy values to the
  30.           move.w    .wrmode(a6),-(sp)   ;* stack, add the writing mode.
  31.           move.l    sp,a0               ;* Save a pointer to intin.
  32.           bra.s     vr_cpyfm            ;* Continue at common point below.
  33.           
  34. _vro_cpyfm::
  35.  
  36.           .cargs    #8,.handle.w,.wrmode.w,.pxy.l,.psource.l,.pdest.l
  37.           link      a6,#0
  38.           
  39.           moveq.l   #109,d0             ;* Function code = copy opaque.
  40.           moveq.l   #1,d1               ;* Number of intin words = 1.
  41.           lea       .wrmode(a6),a0      ;* Save a pointer to intin.
  42. vr_cpyfm:
  43.           .cargs    #8,.handle.w,.wrmode.w,.pxy.l,.psource.l,.pdest.l ;* This is dup'd here due to local symbol scope being trashed by the vr_cpyfm label.
  44.  
  45.           move.l    .pdest(a6),-(sp)    ;* contrl[9-10] -> dest mfdb.
  46.           move.l    .psource(a6),-(sp)  ;* contrl[7-8]  -> source mfdb.
  47.  
  48.           VContrl   d0,,#4,d1           ;* Setup the rest of the contrl stuff.
  49.           
  50.           subq.l    #8,sp               ;* intout/ptsout
  51.           move.l    .pxy(a6),-(sp)      ;* -> ptsin
  52.           move.l    a0,-(sp)            ;* -> intin
  53.           pea       16(sp)              ;* -> contrl
  54.  
  55.           jmp       vdicall
  56.           
  57. ;*------------------------------------------------------------------------
  58. ;* Get pixel.
  59. ;*------------------------------------------------------------------------
  60.  
  61. _v_get_pixel::
  62.           .cargs    #8,.handle.w,.x.w,.y.w,.pel.l,.index.l
  63.           link      a6,#-4              ;* Allocate intout[2].
  64.           
  65.           VContrl   #105,,#1
  66.           
  67.           subq.l    #4,sp               ;* -> ptsout
  68.           pea       -4(a6)              ;* -> intout
  69.           pea       .x(a6)              ;* -> ptsin
  70.           subq.l    #4,sp               ;* -> intin
  71.           pea       16(sp)              ;* -> contrl
  72.  
  73.           moveq.l   #$73,d0
  74.           move.l    sp,d1
  75.           trap      #2
  76.  
  77.           move.l    .pel(a6),a0         ;* Return pixel value
  78.           move.w    -4(a6),(a0)         ;* from intout[0].
  79.           move.l    .index(a6),a0       ;* Return index value
  80.           move.w    -2(a6),(a0)         ;* from intout[1].
  81.  
  82.           unlk      a6
  83.           rts
  84.  
  85. ;*         end of code.                     
  86.